/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.modular.xyethniccate.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.modular.xyethniccate.param.XyEthnicCateParam;
import vip.xiaonuo.modular.xyethniccate.service.XyEthnicCateService;
import vip.xiaonuo.modular.xyethniccate.entity.XyEthnicCate;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
import vip.xiaonuo.sys.core.msg.Result;
import static vip.xiaonuo.sys.core.msg.ResultUtils.success;
/**
 * 族员的 关系排行控制器
 *
 * @author yanwei
 * @date 2023-05-05 15:44:28
 */
@RestController
@Api(tags = "后台管理 族员的 关系排行 相关APIS")
@AdminVersionSwagger
public class XyEthnicCateController {

    @Resource
    private XyEthnicCateService xyEthnicCateService;

    /**
     * 查询族员的 关系排行
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyEthnicCate/page")
    @BusinessLog(title = "族员的 关系排行_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("族员的 关系排行_查询")
    public Result<PageResult<XyEthnicCate>> page(XyEthnicCateParam xyEthnicCateParam) {
        PageResult<XyEthnicCate> page = xyEthnicCateService.page(xyEthnicCateParam);
        return success(page);
    }

    /**
     * 添加族员的 关系排行
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @PostMapping("/xyEthnicCate/add")
    @BusinessLog(title = "族员的 关系排行_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("族员的 关系排行_增加")
    public Result add(@RequestBody @Validated(XyEthnicCateParam.add.class) XyEthnicCateParam xyEthnicCateParam) {
            xyEthnicCateService.add(xyEthnicCateParam);
        return success();
    }

    /**
     * 删除族员的 关系排行，可批量删除
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @PostMapping("/xyEthnicCate/delete")
    @BusinessLog(title = "族员的 关系排行_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("族员的 关系排行_删除")
    public Result delete(@RequestBody @Validated(XyEthnicCateParam.delete.class) List<XyEthnicCateParam> xyEthnicCateParamList) {
            xyEthnicCateService.delete(xyEthnicCateParamList);
        return success();
    }

    /**
     * 编辑族员的 关系排行
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @PostMapping("/xyEthnicCate/edit")
    @BusinessLog(title = "族员的 关系排行_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("族员的 关系排行_编辑")
    public Result edit(@RequestBody @Validated(XyEthnicCateParam.edit.class) XyEthnicCateParam xyEthnicCateParam) {
            xyEthnicCateService.edit(xyEthnicCateParam);
        return success();
    }

    /**
     * 查看族员的 关系排行
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyEthnicCate/detail")
    @BusinessLog(title = "族员的 关系排行_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("族员的 关系排行_查看")
    public Result<XyEthnicCate> detail(@Validated(XyEthnicCateParam.detail.class) XyEthnicCateParam xyEthnicCateParam) {
        XyEthnicCate detail =   xyEthnicCateService.detail(xyEthnicCateParam);
        return success(detail);
    }

    /**
     * 族员的 关系排行列表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyEthnicCate/list")
    @BusinessLog(title = "族员的 关系排行_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("族员的 关系排行_列表")
    public Result<List<XyEthnicCate>> list(XyEthnicCateParam xyEthnicCateParam) {
        List<XyEthnicCate> list  =   xyEthnicCateService.list(xyEthnicCateParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-05-05 15:44:28
     */
    @Permission
    @GetMapping("/xyEthnicCate/export")
    @BusinessLog(title = "族员的 关系排行_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("族员的 关系排行_导出")
    public void export(XyEthnicCateParam xyEthnicCateParam) {
        xyEthnicCateService.export(xyEthnicCateParam);
    }

}
